FUNCTION

decimal.to_integer

pure function to_integer(): integer

Convert this decimal to an integer, truncating the fractional part.

Numerically equivalent to decimal.floor(), but with a type conversion.

Throws

  • exception — if this decimal is greater than integer.MAX_VALUE or less than integer.MIN_VALUE.

Since

0.9.1

© 2026 Chromia